package com.sskj.wallet.bean;

import com.sskj.lib.util.CoinUtil;
import com.sskj.lib.util.CommonUtil;

import java.io.Serializable;
import java.math.BigDecimal;

public class CoinAssetBean implements Serializable {
    private String code;
    private String price="0";//当前USDT价格
    private String cnyPrice="0";//当前人民币价格
    private String available="0";//拥有的币数量
    private String cnyAvailable="0";//拥有的币等价人民币金额
    private String address;
    private String tokenAddress;
    private String contractAddress;
    private String usdt2yuan;//USDT 兑换人民币汇率

    /**
     * 获取拥有币等价USDT数
     */
    public String getUsdt(){
       return new BigDecimal(price).multiply(new BigDecimal(available)).toPlainString();
    }
    public String getUsdt2yuan() {
        return usdt2yuan;
    }

    public void setUsdt2yuan(String usdt2yuan) {
        this.usdt2yuan = usdt2yuan;
    }

    public String getContractAddress() {
        return contractAddress;
    }

    public void setContractAddress(String contractAddress) {
        this.contractAddress = contractAddress;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getTokenAddress() {
        return tokenAddress;
    }

    public void setTokenAddress(String tokenAddress) {
        this.tokenAddress = tokenAddress;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getCnyPrice() {
        return cnyPrice;
    }

    public void setCnyPrice(String cnyPrice) {
        this.cnyPrice = cnyPrice;
    }

    public String getAvailable() {
        return CoinUtil.keepCoin(available);
    }

    public void setAvailable(String available) {
        this.available = available;
    }

    public String getCnyAvailable() {
        return CoinUtil.keepRMB(cnyAvailable);
    }

    public void setCnyAvailable(String cnyAvailable) {
        this.cnyAvailable = cnyAvailable;
    }
}
